home *** CD-ROM | disk | FTP | other *** search
- Path: unsw.edu.au!usenet
- From: s2139589@cse.unsw.edu.au (CC)
- Newsgroups: comp.lang.c++,comp.lang.c
- Subject: HELP!: Error when trying to use cout in MSVC++ 4.0!
- Date: Wed, 13 Mar 1996 05:51:30 GMT
- Organization: University of New South Wales
- Message-ID: <4i5kpd$eic@mirv.unsw.edu.au>
- NNTP-Posting-Host: modem.circus.cse.unsw.edu.au
- X-Newsreader: Forte Free Agent 1.0.82
-
- Hi,
-
- I am having trouble compiling a very simple program consisting of one
- line of code in main(). I am using Microsoft Visual C++ Version 4.0 on
- WIN95. Basically I am trying to use cout to print a word, however the
- compiler keeps generating the following error:
-
- E:\Labs\lab1.c(4) : error C2065: 'cout' : undeclared identifier
- E:\Labs\lab1.c(4) : error C2297: '<<' : bad right operand
- Error executing cl.exe.
- lab1.obj - 2 error(s), 0 warning(s)
-
- Here is my code:
- #include <iostream.h>
-
- void main()
- { cout << "Hi";
- }
-
- I have checked that iostream.h is in the standard include directory
- and I am quite sure that the compiler has found it because I once
- entered iostreams.h instead of iostream.h and it generated an error
- saying it could not find the file. After entering the correct
- name(iostream.h) that error has disappeared, but I get the above
- errors. Everything is fine if I use printf.
- Can someone please tell what is going on and how to fix it?
- Could it be that cout, cin is not supported in MSVC4.0?
-
- Thanks a lot!
-
- CC
- PS. reply by email if possible at s2139589@cse.unsw.edu.au
-
-